//
//  YYJLRankCell.m
//  YuanyangJinlou
//
//  Created by mac004 on 2017/1/5.
//  Copyright © 2017年 suli19910309@qq.com. All rights reserved.
//

#import "YYJLRankRuleCell.h"

@implementation YYJLRankRuleCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setRuleArr:(NSArray *)ruleArr
{
    _ruleArr = ruleArr;
    [self creatUI];
}



- (void)creatUI
{
   
    NSString* first =_ruleArr[0];
    
    NSString * second = _ruleArr[1];
    
        
        UILabel * lab1=[MyControl createLabelWithFrame:CGRectMake(0, 13*PER_HEIGHT, 175*PER_WIDTH, 14*PER_HEIGHT) Font:14 Text:first Color:WHITE_COLOR];
    if (![first isEqualToString:@"加分项目"]) {
        lab1.textColor=FEELT_COLOR;
    }
        lab1.textAlignment=NSTextAlignmentCenter;
        [self.contentView addSubview:lab1];
    
      for (int i = 0; i<2; i++) {
        UIView * line1 = [[UIView alloc]initWithFrame:CGRectMake(i*350*PER_WIDTH, 0, 0.5, 38*PER_HEIGHT)];
        if ([first isEqualToString:@"加分项目"]) {
            line1.height=40*PER_HEIGHT;
            
        }
        line1.backgroundColor=UIColorFromHex(0xcccccc);
        [self.contentView addSubview:line1];
        
    }
    
    UILabel * lab2=[MyControl createLabelWithFrame:CGRectMake(176*PER_WIDTH, 13*PER_WIDTH, 175*PER_WIDTH, 14) Font:14 Text:second Color:WHITE_COLOR];
    lab2.textAlignment=NSTextAlignmentCenter;
    if (![first isEqualToString:@"加分项目"]) {
        lab2.font=[UIFont fontWithName:HLT size:14];
        lab2.textColor=UIColorFromHex(0xdea556);
        lab2.height=12*PER_HEIGHT;
    }
    
    [self.contentView addSubview:lab2];
    
    UIView* line2 =[[UIView alloc]initWithFrame:CGRectMake(0, 38*PER_HEIGHT-0.5, self.width, 0.5)];
    line2.backgroundColor=UIColorFromHex(0xcccccc);
    if ([first isEqualToString:@"加分项目"]) {
        return;
    }
    [self.contentView addSubview:line2];
}

@end
